package org.example.syn;

import java.util.concurrent.locks.ReentrantLock;

/**
 * @author: lynn
 * @Descript:
 * @date: 2021/6/1 18:26
 * @version: 1.0
 */
public class SynClass {
    public static void main(String[] args) {


        Object o=new Object();
        ReentrantLock reentrantLock=new ReentrantLock(true);

        synchronized(o){
            System.out.println("aaaa");
        }

        StringBuffer sb=new StringBuffer();
        for (int i = 0; i <1000 ; i++) {
            sb.append(i).append(i);
        }


    }
    public synchronized void test(){
        System.out.println("dddd");

    }
}
